<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading">线下活动费用
      <?php if (in_array($action, array('edit'))) {?>
      <a class="btn btn-default col-md-offset-10" onclick="newWindow('新增线下活动','<?=printUrl('SpecialPOffline','add', array('procId'=>$procId,'projectId'=>$projectId))?>',1000,600)">新增</a>
      <?php } ?>
  </div>
  <table class="table table-bordered">
    <thead>
      <tr>
        <th class="bg-primary text-center">流水号</th>
        <th class="bg-primary text-center">活动地址</th>
        <th class="bg-primary text-center">发布时间段</th>
        <th class="bg-primary text-center">预算费用</th>
        <th class="bg-primary text-center">备注</th>
        <th class="bg-primary text-center">明细</th>
        <th class="bg-primary text-center">预算审核结果</th>
        <?php if (in_array($action, array('edit','audit'))) {?>
        <th class="bg-primary text-center">操作</th>
        <?php } ?>
      </tr>
    </thead>
    <tbody>
    <?php foreach($offlineList as $k => $v): ?>
      <tr>
        <td class="text-center"><?php echo $v['id']; ?></td>
        <td class="text-center"><?php echo $v['address']; ?></td>
        <td class="text-center"><?php echo $v['startTime'].'至'.$v['endTime'] ?></td>
        <td class="text-center"><?php echo $v['budgetApply'] ?></td>
        <td class="text-center"><?php echo $v['remarks'] ?></td>
        <td class="text-center">
            <a type="button" onclick="newWindow('查看活动明细', '<?=printUrl('SpecialPOffline','detailCheck', array('offlineId'=>$v['id']))?>', 800, 400)" class="btn btn-default">查看</a>
        </td>
        <td class="text-center"><?php echo $v['budgetAuditStr'] ?></td>
        <?php if (in_array($action, array('edit'))) {?>
        <td class="text-center">
          <?php if (in_array($v['budgetAuditRs'], array(-1,0,3) ) ){?>
          <a class="btn btn-default" onclick="newWindow('修改线下活动','<?=printUrl('SpecialPOffline','add', array('offlineId'=>$v['id'],'procId'=>$v['procId'],'projectId'=>$v['projectId']))?>',1000,600)">修改</a>
          <a class="btn btn-default" onclick="ajaxConfirmSubmit('您确定要删除此线下活动吗？<br>此操作不可撤销','<?=printUrl('SpecialPOffline','del')?>',{'offlineId':<?=$v['id']?>})">删除</a>
          <?php } ?>
        </td>
        <?php } ?>
        <?php if (in_array($action, array('audit'))) {?>
        <td class="text-center">
          <?php
          $options = $this->config->item('budgetAuditOptions');
          $extra = ' class="form-control"  style="width:70px;" ';
          if ($v['settleAuditRs'] > -1 || $this->user['userRole'] < $v['budgetAuditRole']) {
            $extra .= " disabled";
          }
          echo form_dropdown('offline['.$v['id'].'][budgetAuditRs]', $options, $v['budgetAuditRs'], $extra);
          ?>
        </td>
        <?php } ?>
      </tr>
    <?php endforeach; ?>
    </tbody>
  </table>
</div>